load(
    "@rules_rust//cargo:defs.bzl",
    "cargo_build_script",
)
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

cargo_build_script(
    name = "build_script",
    srcs = ["build_script.rs"],
    build_script_env = {"SOME_ENV": "42"},
    crate_features = ["bleh"],
    data = ["test.txt"],
)

rust_library(
    name = "lib",
    srcs = ["lib.rs"],
    deps = [":build_script"],
)

rust_test(
    name = "test",
    crate = ":lib",
)
